#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/rope>
#define rep(i,l,r) for(int i=(l),i##end=(r);i<=i##end;++i)
#define per(i,r,l) for(int i=(r),i##end=(l);i>=i##end;--i)
#define ll long long
#define int ll
#define double long double
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define popcnt __builtin_popcount
#define rbtree(way) tree<way,null_type,less<way>,rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
class IO{
    char ibuf[1<<16],obuf[1<<16],*ipl=ibuf,*ipr=ibuf,*op=obuf;
    public:
    ~IO(){write();}
    inline void read(){ipl==ipr?ipr=(ipl=ibuf)+fread(ibuf,1,1<<15,stdin):0;}
    inline void write(){fwrite(obuf,1,op-obuf,stdout),op=obuf;}
    inline char getchar(){return (read(),ipl!=ipr)?*ipl++:EOF;}
    inline void putchar(char c){*op++=c;if(op-obuf>(1<<15)) write();}
    template<typename V>IO&operator>>(V&v){
        int s=1;char c=getchar();v=0;
        for(;!isdigit(c);c=getchar()) if(c=='-') s=-s;
        for(;isdigit(c);c=getchar()) v=(v<<1)+(v<<3)+(c^48);
        return v*=s,*this;
    }
    inline IO&operator<<(char c){return putchar(c),*this;}
    template<typename V>IO&operator<<(V v){
        if(!v) putchar('0');
		if(v<0) putchar('-'),v=-v;
        char stk[100],*top=stk;
        for(;v;v/=10) *++top=v%10+'0';
        while(top!=stk) putchar(*top--);
		return *this;
    }
}io;
#define cin io
#define cout io
#define Tie (ios::sync_with_stdio(0),cin.tie(0),cout.tie(0))
const int maxn=(1<<20)+10,maxm=1e6+10,mod=998244353,inf=INT_MAX;
inline int ksm(int x,int k,int mod=mod){
	int ans=1;
	for(x%=mod;k;k>>=1,x=x*x%mod) if(k&1) ans=ans*x%mod;
	return ans;
}

int n,ans;
pii a[maxn];

signed main(){
	freopen("game.in","r",stdin),freopen("game.out","w",stdout);
	cin>>n;
	int lmx=-inf,rmx=inf,umx=-inf,dmx=inf;
	rep(i,1,n) cin>>a[i].fi>>a[i].se,lmx=max(lmx,a[i].fi),umx=max(umx,a[i].se),
		rmx=min(rmx,a[i].fi),dmx=min(dmx,a[i].se);
	int x=lmx-rmx+1,y=umx-dmx+1,ans=0;
	if(x*y==n){
		rep(i,1,x) ans-=y*y*(x-2*i+1)*i;
		rep(i,1,y) ans-=x*x*(y-2*i+1)*i;
		cout<<ans;
		return 0;
	}
	rep(i,1,n) rep(j,i,n) ans+=abs(a[i].fi-a[j].fi)+abs(a[i].se-a[j].se);
	cout<<ans;
	return 0;
}
